home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-01 | 3.0 KB | 129 lines | [TEXT/KAHL] |
- ///--------------------------------------------------------------------------------------
- // Application.h
- //
- // Created: Sunday, April 11, 1993
- // By: Tony Myles
- //
- // Copyright: © 1993-94 Tony Myles, All rights reserved worldwide.
- ///--------------------------------------------------------------------------------------
-
-
- #ifndef __APPLICATION__
- #define __APPLICATION__
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
-
- enum
- {
- kMenuBarResID = 128,
- kWindowResID = 128
- };
-
- enum
- {
- kAppleMenuID = 128,
- kFileMenuID = 129,
- kEditMenuID = 130,
- kSpriteMenuID = 131,
- kTestMenuID = 132
- };
-
- enum
- {
- // file menu
- kAboutItem = 1,
- kQuitItem = 1,
-
- // edit menu
- kUndoItem = 1,
- kCutItem = 3,
- kCopyItem,
- kPasteItem,
- kClearItem,
- kSelectAllItem,
-
- // sprite menu
- kCreateSpriteItem = 1,
- kHideTitleItem = 3,
- kHideBallsItem,
-
- // test menu
- kRunTestItem = 1,
- kSetUpTestItem = 3,
- kCollisionDetectionItem = 5,
- kMonitorDepthItem = 7
- };
-
- enum
- {
- kForeGroundSleepTime = 0,
- kBackGroundSleepTime = 0
- };
-
- enum
- {
- kErrorAlertResID = 128,
- kMonitorDepthResID = 300,
- kErrorStringListResID = 128,
- kUnknownErrorStringIndex = 1,
- kCantFindResourceStringIndex = 2,
- kNotEnoughMemoryStringIndex = 3,
- kCantRunStringIndex = 4
- };
-
- enum
- {
- k1BitDepthButton = 3,
- k4BitDepthButton,
- k8BitDepthButton,
- k16BitDepthButton,
- k32BitDepthButton
- };
-
-
- #define kSeriousDamageString "\pCould not even get error string!\rThis application is seriously damaged!"
-
- /*
- pascal OSErr SetDialogDefaultItem( DialogPtr theDialog,
- short newItem ) = { 0x303C, 0x0304, 0xAA68 };
- pascal OSErr SetDialogCancelItem( DialogPtr theDialog,
- short newItem ) = { 0x303C, 0x0305, 0xAA68 };
- */
-
- void main(void);
- void Initialize(short numberOfMasters);
- void CreateMenuBar(void);
- void CreateWindow(void);
- Boolean EnterApplication(void);
- void ExitApplication(void);
- void ServiceEvents(void);
- void DispatchEvent(EventRecord* event);
- void HandleMouseEvent(EventRecord* event);
- void HandleKeyEvent(char key, short modifiers);
- void HandleUpdateEvent(WindowPtr updateWindowP);
- void HandleActivateEvent(WindowPtr updateWindowP);
- void HandleOSEvent(long message);
- void HandleDiskEvent(long message);
- void HandleNullEvent(void);
- void HandleMenuCommand(long menuItemIdentifier);
- void HandleAppleMenuCommand(short menuItem);
- void HandleFileMenuCommand(short menuItem);
- void HandleEditMenuCommand(short menuItem);
- void HandleSpriteMenuCommand(short menuItem);
- void HandleTestMenuCommand(short menuItem);
- void AdjustMenuItems(void);
- pascal OSErr HandleOpenApp(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
- pascal OSErr HandleOpenDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
- pascal OSErr HandlePrintDoc(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
- pascal OSErr HandleQuit(AppleEvent srcAppleEvent, AppleEvent replyAppleEvent, long refCon);
- void MonitorDepthDialog(void);
- void SetMonitorDepthButtons( DialogPtr theDialog, short theDepth);
- void ErrorAlert(OSErr err, short errorStringIndex);
- void CantFindResource(void);
- void CantRunOnThisMachine(void);
-
-
- #endif /* __APPLICATION__ */